<include file="Public:header" />
<script charset="utf-8" src="__PUBLIC__/Admin/kindeditor/kindeditor-min.js"></script>
<script>
    <!--
    KindEditor.ready(function(K) {
        var detaileditor;
        var contenteditor;
            <eq name="is_top" value="1">
            contenteditor = K.create('#content', {
            resizeType : 0,
            newlineTag : 'br',
            items : ['source', '|', 'fontsize', 'forecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', '|', 'table', 'removeformat', 'preview'],
            afterChange : function() {
                var term = contenteditor.text();
                var termlen = term.length;
                var remainlen = {$allow.cell_contentlen} - termlen;
                if (remainlen<0){
                    alert("您输入的内容太长，请删除多余字符！");
                    if(document.getElementById('contentlen'))
                        document.getElementById('contentlen').innerHTML = '0';
                } else {
                    if(document.getElementById('contentlen'))
                        document.getElementById('contentlen').innerHTML = remainlen;
                }
            }
        });
            </eq>
            detaileditor = K.create('#content', {newlineTag : 'br'});
    });
    $(function(){
        $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
        $("#catid").formValidator({onshow:"请选择信息分类",onfocus:"请选择信息分类",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请选择信息分类"});
        $("#title").formValidator({onshow:"请输入标题",onfocus:"请输入标题",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入标题"});
//        $("#uid").formValidator({onshow:"请输入会员ID",onfocus:"会员ID应该为大于等于0的整数"}).inputValidator({max:5,onerror:"会员ID应该为大于等于0的整数"}).regexValidator({regexp:"num1",datatype:"enum",param:'i',onerror:"会员ID应该为大于等于0的整数"});
//        $("#linkurl").formValidator({empty:true,onshow:"请填写链接URL",onfocus:"请填写链接URL"}).inputValidator({onerror:"请填写链接URL"}).regexValidator({regexp:"url",datatype:"enum",param:'i',onerror:"链接URL格式错误"});
    })
    function delPic(obj) {
        var src = $('#picurl').val();
        $.get("__APP__?m=Article&a=delpic&picurl="+src);
        $('#picshow').html('');
        $('#picurl').val('');
    }
    //-->
</script>
<div class="common-form">
    <div style="clear:both;"><a href="{:U('Article/index')}" class="navbtn">返回{$modulename}管理</a></div>
    <form name="myform" id="myform" action="{:U('Article/update')}" method="post">
        <input type="hidden" name="id" value="{$vo.id}">
        <input type="hidden" name="is_top" value="{$is_top}">
<!--        <input type="hidden" name="picurl" id="picurl" value="{$vo.picurl}">-->
        <input type="hidden" name="topnum" value="{$vo.topnum}">
        <table width="100%" class="table_form contentWrap">
            <tr>
                <td align="right" width="80">文章标题：</td>
                <td align='left'><input type="text" name="title" id="title" onkeyup="checkLen(this,{$CFG.cell_titlelen},'titlelen');" onchange="checkLen(this,{$CFG.cell_titlelen},'titlelen');" value="{$vo.title}" size="60">
                    {:show_style('toptitle')} 不能超过{$CFG.cell_titlelen}个字符，还可以输入 <span id="titlelen" class="red">{$CFG.cell_titlelen}</span> 字
                </td>
            </tr>
            <tr>
                <td align="right">文章摘要：</td>
                <td align='left' id="td_txt">
                    <textarea name='summary' id='summary' style="width:480px;height:140px;"
                              onchange="checkLen(this,{$CFG.cell_contentlen},'contentlen');"
                              onkeyup="checkLen(this,{$CFG.cell_contentlen},'contentlen');">{$vo.summary}
                    </textarea>
                    不能超过{$CFG.cell_contentlen}个字符，还可以输入 <span id="contentlen" class="red">{$CFG.cell_contentlen}</span> 字
                </td>
            </tr>
            <tr>
                <td align="right">文章内容：</td>
                <td align='left'><textarea name='content' id='content' style='height:400px;width:700px;'>{$vo.content}</textarea></td>
            </tr>
            <tr>
                <td align="right">文章分类：</td>
                <td align='left'>
                    <select name="catid" id='catid'>
                        <option value="0" selected>--选择分类--</option>
                        <volist name="CATEGORY" id="cate"><!--此处的不能用vo。困为前面已经有vo赋值过来了，要不然后面的vo都不会显示（$vo.tags）-->
                            <option value="{$cate.id}" <eq name="cate.id" value="$vo.catid">selected</eq>>{$cate.catname}</option>
                        </volist>
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">标签：</td>
                <td align='left'><input type="text" name="tags" maxlength='54' size="60" value="{$vo.tags}"> 多个标签用空格分开（暂不支持逗号）</td>
            </tr>
            <tr>
                <td align="right"></td>
                <td align='left'><input type="submit" id="dosubmit" class="button" name="dosubmit" value=" 提 交 "/></td>
            </tr>
        </table>
        <div class="bk15"></div>
    </form>
</div>
<include file="Public:footer" />